<template>
    <div>
      <br />

      <myheader/>

     
      <div class="container">

          <div class="item_column">
              <div class="left">   
                  
              </div>

              <div class="right"> 
                <br />
                <br />

                <h1>审核列表</h1>
               
                <div>
                    <ul>
                        <li v-for='i in list'>{{i.name}}
                            <van-button @click='audit(i.id)'>审核</van-button>
                        </li>
                    </ul>
                          
                    <van-dialog v-model:show="show" title="标题" show-cancel-button>
                      
                             <van-field :label='描述信息' v-model='descipt'/>
                            <van-radio-group v-model="is_agree">
                                    <van-radio name="2">通过</van-radio>
                                    <van-radio name="3">未通过</van-radio>
                            </van-radio-group>
                            <van-button @click='submit'>提交</van-button> 
                          </van-dialog>
                </div>
                
              </div>

          </div>

      </div>
      
    </div>
</template>
  
<script>
// import maxios from '../http/axios'
import axios from 'axios'
import myheader from './myheader.vue'

  export default {
    components: {
      'myheader':myheader,
      
    },
  
    data() {
      return {
        list:[],
        show:false,
        descipt:'',
        is_agree:2,
        id:0,

       
      }
    },
    methods: {

        getlist(){
            
            axios.get('http://localhost:8000/showuseraudit').then(res => {

                this.list = res.data.list
            })

        },

        audit(id){

            this.id = id
            this.show = true
        },

        submit(){

            axios.post('http://localhost:8000/audit',{'id':this.id,'descipt':this.descipt,'is_agree':this.is_agree}).then(res => {

                console.log(res)
            })
        }

    },
    mounted() {
       this.getlist()
    }
  }
</script>
  
<style scoped>
@import url("../assets/style.css");

</style>